package com.sure.yyr.security.login.dao;

import com.sure.yyr.security.login.LoginDto;
import com.sure.yyr.security.login.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

public interface LoginDao {

    @Select("select count(u_id) from sys_user where u_id = #{u_id} and u_pwd= #{u_pwd}")
    int findCountByUserIdAndPassword(LoginDto dto);

    @Insert("insert into sys_user(u_id,u_name,u_pwd,u_status) values(#{u_id},#{u_name},#{u_pwd},#{u_status})")
    void insertUser(LoginDto dto);

    @Select("select u_id,u_name,u_sex,u_birth,u_avatar from sys_user where u_id = #{u_id}")
    User findUserById(String u_id);
}
